package com.pingba.serviceImpl;


import com.pingba.dao.BaseDao;
import com.pingba.dao.UserDao;
import com.pingba.entity.User;
import com.pingba.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * Created by Administrator on 2015/8/15.
 */
@Service(value = "UserService")
public class UserServiceImpl extends BaseServiceImpl<User,Long> implements UserService {

    @Autowired
    private UserDao userDao;

    @Override
    public BaseDao<User, Long> getDao() {
        return userDao;
    }

    @Override
    public User findPhoneUser(String phone) {
        return userDao.findPhoneUser(phone);
    }

    @Override
    public void setPasswd(String phone, String passwd) {
        userDao.setPasswd(phone,passwd);
    }

    @Override
    public User login(String phone, String passwd) {
        return userDao.login(phone, passwd);
    }

    @Override
    public void updateLoginTime(String phone, long date) {
        userDao.updateLoginTime(phone, date);
    }

    @Override
    public void updateInfo(User user) {
        userDao.updateInfo(user);
    }

    @Override
    public void updateHeadUrlChangeTime(User user) {
        userDao.updateHeadUrlChangeTime(user);
    }

    @Override
    public User findByWeCharUnionId(String weCharUnionId) {
        return userDao.findByWeCharUnionId(weCharUnionId);
    }

    @Override
    public User findIdUser(long id) {
        return userDao.selectByPrimaryKey(id);
    }

    @Override
    public void updateLocationInfo(User user) {
        userDao.updateLocationInfo(user);
    }
}
